import axios from './http'
import base from './base'

export function login(data) { //登录接口
    return axios({
        url: `${base.url}/API/login`,
        method: 'post',
        // data: QS.stringify(data)
        data: data
    })
}


export function uploadtoken(data) { //上传接口
    console.log(data)
    return axios({
        url: `${base.url}/API/get_token`,
        method: 'get',

    })
}

export function addproject(data) { //添加项目接口
    return axios({
        url: `${base.url}/API/addProject`,
        method: 'post',
        data: data
    })
}

export function getproject(data) { //获取项目表中的内容
    console.log(data)

    return axios({
        url: `${base.url}/API/getProject`,
        method: 'get',

    })
}

export function addGroup(data) { //添加分组表中的内容
    return axios({
        url: `${base.url}/API/addGroup`,
        method: 'post',
        data: data
    })
}

export function getGroup(data) { //获取分组中的表中的内容
    return axios({
        url: `${base.url}/API/getGroup`,
        method: 'POST',
        data: data,
    })
}

export function updateGroupObj(data) { //更新分组中的表中的内容
    return axios({
        url: `${base.url}/API/updateGroup`,
        method: 'POST',
        data: data,
    })
}

export function deleteGroupObj(data) { //删除分组中的表中的内容
    return axios({
        url: `${base.url}/API/deleteGroup`,
        method: 'POST',
        data: data,
    })
}

export function addInterface(data) { //添加接口
    return axios({
        url: `${base.url}/API/addInterface`,
        method: 'post',
        data: data
    })
}

export function getInterface(data) { //获取接口列表
    return axios({
        url: `${base.url}/API/getInterface`,
        method: 'POST',
        data: data,
    })
}

export function updateInterfaceObj(data) { //修改接口中内容
    return axios({
        url: `${base.url}/API/updateInterface`,
        method: 'POST',
        data: data,
    })
}

export function deleteInterfaceObj(data) { //删除接口中的表中的内容
    return axios({
        url: `${base.url}/API/deleteInterface`,
        method: 'POST',
        data: data,
    })
}

export function copyCaseObj(data) { //复制当前用例中的内容
    return axios({
        url: `${base.url}/API/copyCurrentCase`,
        method: 'POST',
        data: data,
    })
}


export function addCase(data) { //添加接口
    return axios({
        url: `${base.url}/API/addCase`,
        method: 'post',
        data: data
    })
}

export function getCase(data) { //获取case列表
    return axios({
        url: `${base.url}/API/getRelatecaseData`,
        method: 'POST',
        data: data,
    })
}

export function updateCaseObj(data) { //修改case中内容
    return axios({
        url: `${base.url}/API/updateCase`,
        method: 'POST',
        data: data,
    })
}

export function deleteCaseObj(data) { //删除case中的表中的内容
    return axios({
        url: `${base.url}/API/deleteCase`,
        method: 'POST',
        data: data,
    })
}


export function getRequest(data) { //获取单个request
    return axios({
        url: `${base.url}/API/getRequest`,
        method: 'POST',
        data: data,
    })
}


export function getAllCass(data) { //获得所有用例
    return axios({
        url: `${base.url}/API/getRequesRelatecase`,
        method: 'POST',
        data: data,
    })
}

export function getcheckpoint(data) { //检查点
    return axios({
        url: `${base.url}/API/checkCasePoint`,
        method: 'POST',
        data: data
        // data: QS.stringify(data)
    })
}

export function getcheckCase(data) { //检查测试用例
    return axios({
        url: `${base.url}/API/checkCase`,
        method: 'POST',
        data: data
    })
}


export function getTestDB() { //获得数据库连接列表
    return axios({
        url: `${base.url}/API/getTestDB`,
        method: 'POST',
    })
}

export function getTestSQL(data) { //检查SQL语句
    return axios({
        url: `${base.url}/API/getSqlresultValue`,
        method: 'POST',
        data: data
    })
}


export function getHerders(data) { //获取herders库
    console.log(data)

    return axios({
        url: `${base.url}/API/getHeaders`,
        method: 'POST',
    })
}


export function AssertionCase(data) { //检查herders
    return axios({
        url: `${base.url}/API/assertionCase`,
        method: 'POST',
        data: data
    })
}


export function getOneCase(data) { //检查获得单个用例
    return axios({
        url: `${base.url}/API/getSingleCase`,
        data: data,
        method: 'POST',

    })
}

export function executionCase(data) { //执行用例
    return axios({
        url: `${base.url}/API/executionCase`,
        data: data,
        method: 'POST',

    })
}

export function gettingUseCases(data) { //根据项目/分组/请求查询用例
    return axios({
        url: `${base.url}/API/getDetailCasereQuest`,
        data: data,
        method: 'POST',

    })
}

export function getTestPlanCases(data) { //获取测试计划中用例筛选条件后的用例
    return axios({
        url: `${base.url}/API/getDetailTestcase`,
        data: data,
        method: 'POST',

    })
}

export function addTestPlan(data) { //获取测试计划中用例筛选条件后的用例
    return axios({
        url: `${base.url}/API/addTestPlan`,
        data: data,
        method: 'POST',

    })
}

export function queryTestPlan(data) { //查询所有的测试计划
    return axios({
        url: `${base.url}/API/queryTestPlan`,
        data: data,
        method: 'POST',

    })
}

export function deleteTestPlan(data) { //删除测试计划
    return axios({
        url: `${base.url}/API/deleteTestPlan`,
        data: data,
        method: 'POST',

    })
}

export function executetTestPlan(data) { //执行测试计划内容
    return axios({
        url: `${base.url}/API/executetTestPlan`,
        data: data,
        method: 'POST',

    })
}

export function addPublicInterface(data) { //添加公共接口
    return axios({
        url: `${base.url}/API/addPublicInterface`,
        data: data,
        method: 'POST',

    })
}


export function queryPublicInterface(data) { //查询公共接口
    return axios({
        url: `${base.url}/API/queryPublicInterface`,
        data: data,
        method: 'POST',

    })
}

export function getPublicInterface(data) { //获取公共接口
    return axios({
        url: `${base.url}/API/getPublicInterface`,
        data: data,
        method: 'POST',

    })
}

export function runNerPublicInterface(data) { //运行公共接口
    return axios({
        url: `${base.url}/API/runPublicInterface`,
        data: data,
        method: 'POST',
    })
}

export function delPublicInterface(data) { //删除测试计划内容
    return axios({
        url: `${base.url}/API/delPublicInterface`,
        data: data,
        method: 'POST',
    })
}

export function getReportPlan(data) { //获取测试计划报告
    return axios({
        url: `${base.url}/API/getReportPlan`,
        data: data,
        method: 'POST',
    })
}

export function getReportCase(data) { //获取报告测试用例
    return axios({
        url: `${base.url}/API/getReportCase`,
        data: data,
        method: 'POST',
    })
}

export function addEmail(data) { //添加邮件
    return axios({
        url: `${base.url}/API/addEmail`,
        data: data,
        method: 'POST',
    })
}

export function getEmail(data) { //获取邮件地址
    return axios({
        url: `${base.url}/API/getAllEmail`,
        data: data,
        method: 'POST',
    })
}

export function testEmail(data) { //测试发送邮件
    return axios({
        url: `${base.url}/API/sendEmail`,
        data: data,
        method: 'POST',
    })
}

export function adduserPresonnel(data) { //新增修改用户
    return axios({
        url: `${base.url}/API/addAlterUser`,
        data: data,
        method: 'POST',
    })
}

export function getPresonnel(data) { //获取用户信息
    return axios({
        url: `${base.url}/API/getUserData`,
        data: data,
        method: 'POST',
    })
}

export function getALLPresonnel(data) { //获取全部用户
    return axios({
        url: `${base.url}/API/getAllUserdata`,
        data: data,
        method: 'POST',
    })
}

export function delPresonnel(data) { //删除用户
    return axios({
        url: `${base.url}/API/deleteUserdata`,
        data: data,
        method: 'POST',
    })
}